package nl.sogyo.objectvisualisatie.GUI;

import java.awt.BorderLayout;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class InputPane {
	
	private JPanel mainPanel = new JPanel();
	//TEXT WITHIN THE TEXTFIELD ARE DEPENDENT ON THE LOCATION OF THE MONITORING PROJECT
	private JTextField classpath = new JTextField("C:\\Users\\Ben\\workspace\\Example\\bin");
	private JTextField mainclass = new JTextField("example2.GUIMain");
	private JTextField sourcepath = new JTextField("C:\\Users\\Ben\\workspace\\Example\\src\\example2\\");
//	private String mainClass = "example2.GUIMain";//"testapps.Testmain";//	// Main-klasse van het project dat wordt gemonitord
//	private String classpath =  "-classpath C:\\Users\\Ben\\workspace\\Example\\bin";  // path waar de .class bestanden staan
//	private String sourcepath = "C:\\Users\\Ben\\workspace\\Example\\src\\example2\\"; // path waar de .java bestanden staan (broncode)

	public InputPane()
	{
		mainPanel.add(new JLabel("Classpath: "));
		mainPanel.add(classpath);
		mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.LINE_AXIS));//Y_AXIS));
		mainPanel.add(new JLabel("Main class: "));
		mainPanel.add(mainclass);
		mainPanel.add(new JLabel("Sourcepath: "));
		mainPanel.add(sourcepath);
		
		JPanel leftPanel = new JPanel();
		JPanel rightPanel = new JPanel();
		leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
		leftPanel.add(new JLabel("Classpath: "));
		leftPanel.add(Box.createVerticalGlue());
		leftPanel.add(new JLabel("Main class: "));
		leftPanel.add(Box.createVerticalGlue());
		leftPanel.add(new JLabel("Sourcepath: "));
		rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
		rightPanel.add(classpath);
		rightPanel.add(mainclass);
		rightPanel.add(sourcepath);
		mainPanel.setLayout(new BorderLayout());
		mainPanel.add(leftPanel, BorderLayout.WEST);
		mainPanel.add(rightPanel, BorderLayout.EAST);
	}
	  
	public String getClasspath()
	{
		return classpath.getText();
	}
	 
	public String geMainclass()
	{
		return mainclass.getText();
	}
	
	public String geSourcepath()
	{
		return sourcepath.getText();
	}
	 
	// get the mainPanel to place into a JOptionPane
	public JComponent getComponent()
	{
		return mainPanel;
	}
}

